﻿{extend name="../../admin/view/main"}

{block name="content"}
<style>
    .layui-form-label{
        padding:0px!important;
        line-height: 38px;
        width: 100px;
        text-align: center;
    }
    .w10{width:10%}
    .w20{width:20%}
    .w25{width:25%}
    .w30{width:30%}
    .w33{width:33.33%}
    .w40{width:40%}
    .w45{width:45%}
    .w50{width:50%}
    .w60{width:60%}
    .w70{width:70%}
    .w80{width:80%}
    .w100{width:100%}
    .notice{
        position: absolute;
    right: 3px;
    top: 5px;
    color: red;
    font-style: normal;
    }
</style>
<form action="{:sysuri()}" class="layui-card layui-form" data-auto="true" method="post">
    <div class="layui-card-body">
        
        <div class="layui-form-item" style="display:flex">
            <div class="layui-inline w50"> 
            <label class="layui-form-label">所属分类</label>
            <div class="layui-input-block">
            <select class="layui-select" lay-search name="cat">
                
                {foreach $cates as $cate}
                
                <?php if(isset($vo['cat']) && (implode(",",$cate['ids']) == $vo['cat'])){?>
                
                <option selected value="{:join(',', $cate.ids)}">{:join(' ＞ ', $cate.names)}</option>
                
                <?php }else{ ?>
                
                <option value="{:join(',', $cate.ids)}">{:join(' ＞ ', $cate.names)}{$vo['cat']}</option>
                
                <?php }?>
                
                {/foreach}
                
            </select>
            </div>
            </div>
            <div class="layui-inline w50"> 
            <label class="layui-form-label">商品编号</label>
            <div class="layui-input-block" style="position:relative">
            <input class="layui-input" name="no" placeholder="请输入商品名称" id="no_input" value="{$vo.no|default=''}">
            <!--i class=notice style="float:right;">重复</i-->
            </div>
            </div>
        </div>
        
        <div class="layui-form-item" style="display:flex">
            <div class="layui-inline w50"> 
            <label class="layui-form-label">商品中文名称</label>
            <div class="layui-input-block">
            <input class="layui-input" name="name" placeholder="请输入商品名称" value="{$vo.name|default=''}">
            </div>
            </div>
            <div class="layui-inline w50"> 
            <label class="layui-form-label">Ename</label>
            <div class="layui-input-block">
            <input class="layui-input" name="ename" placeholder="" value="{$vo.ename|default=''}">
            </div>
            </div>
        </div>
        
        <!--div class="layui-form-item" style="display:flex">
            <div class="layui-inline w50"> 
            <label class="layui-form-label">材质</label>
            <div class="layui-input-block">
            <input class="layui-input" name="material" placeholder="请输入" value="{$vo.material|default=''}">
            </div>
            </div>
            <div class="layui-inline w50"> 
            <label class="layui-form-label">Material</label>
            <div class="layui-input-block">
            <input class="layui-input" name="ematerial" placeholder="请输入" value="{$vo.ematerial|default=''}">
            </div>
            </div>
        </div>
        
        <div class="layui-form-item" style="display:flex">
            <div class="layui-inline w50"> 
            <label class="layui-form-label">尺寸</label>
            <div class="layui-input-block">
            <input class="layui-input" name="size" placeholder="请输入" value="{$vo.size|default=''}">
            </div>
            </div>
            <div class="layui-inline w50"> 
            <label class="layui-form-label">Size</label>
            <div class="layui-input-block">
            <input class="layui-input" name="esize" placeholder="请输入" value="{$vo.size|default=''}">
            </div>
            </div>
        </div>
        
        <div class="layui-form-item" style="display:flex">
            <div class="layui-inline w50"> 
            <label class="layui-form-label">重量</label>
            <div class="layui-input-block">
            <input class="layui-input" name="weight" placeholder="请输入" value="{$vo.weight|default=''}">
            </div>
            </div>
            <div class="layui-inline w50"> 
            <label class="layui-form-label">Weight</label>
            <div class="layui-input-block">
            <input class="layui-input" name="eweight" placeholder="请输入" value="{$vo.eweight|default=''}">
            </div>
            </div>
        </div>
        
        <div class="layui-form-item" style="display:flex">
            <div class="layui-inline w50"> 
            <label class="layui-form-label">function</label>
            <div class="layui-input-block">
            <input class="layui-input" name="function" placeholder="请输入" value="{$vo.function|default=''}">
            </div>
            </div>
            <div class="layui-inline w50"> 
            <label class="layui-form-label">功能</label>
            <div class="layui-input-block">
            <input class="layui-input" name="efunction" placeholder="请输入" value="{$vo.efunction|default=''}">
            </div>
            </div>
        </div-->
        
        <div class=layui-form-item>
            
            <label class="layui-form-label">参数描述</label>
            <div class="layui-input-block">
            <textarea class="layui-hide" name="canshu" placeholder="请输入" id=canshu >{$vo.canshu|default=''}</textarea>
            <script>
                require(['ckeditor'], function () {window.createEditor('[name=canshu]', {height:200});})
            </script>
            </div>
        </div>
        
        
        <div class=layui-form-item>
            
            <label class="layui-form-label">弹出描述</label>
            <div class="layui-input-block">
            <textarea class="layui-hide" name="pcanshu" placeholder="请输入" id=pcanshu >{$vo.pcanshu|default=''}</textarea>
            <script>
                require(['ckeditor'], function () {window.createEditor('[name=pcanshu]', {height:200});})
            </script>
            </div>
        </div>
        
        <!--div class="layui-form-item">
            <div class="layui-inline " style="width:33.33%"> 
            <label class="layui-form-label">货号</label>
            <div class="layui-input-block">
            <input class="layui-input" name="hno" placeholder="请输入" value="{$vo.hno|default=''}">
            </div>
            </div>
            <div class="layui-inline" style="width:33.33%"> 
            <label class="layui-form-label">生产厂家</label>
            <div class="layui-input-block">
            <input class="layui-input" name="company" placeholder="请输入" value="{$vo.company|default=''}">
            </div>
            </div>
            <div class="layui-inline" style="width:33.33%"> 
            <label class="layui-form-label">价格</label>
            <div class="layui-input-block">
            <input class="layui-input" name="price" placeholder="请输入" value="{$vo.price|default=''}">
            </div>
            </div>
        </div-->
        
        




        <div class="layui-form-item">
            <table class="layui-table">
                <thead>
                <tr>
                    <!--th class="text-left">封面(347px*347px)</th-->
                    <th class="text-left" style="width:100%">轮播图片(1200px*1200px)</th>
                </tr>
                <tr>
                    <!--td class="text-center text-top padding-0">
                        <div class="help-images">
                            <input name="cover" data-max-width="347" data-max-height="347" type="hidden" value="{$vo.cover|default=''}">
                            <script>$('[name="cover"]').uploadOneImage();</script>
                        </div>
                    </td-->
                    <td class="text-left padding-0">
                        <div class="help-images">
                            <input name="slider" type="hidden" value="{$vo.slider|default=''}">
                            <script>$('[name="slider"]').uploadMultipleImage();</script>
                        </div>
                    </td>
                </tr>
                </thead>
            </table>
        </div>

        


        <div class="hr-line-dashed margin-top-40"></div>
        {notempty name='vo.id'}<input name="id" type="hidden" value="{$vo.id}">{/notempty}

        <div class="layui-form-item text-center">
            <button class="layui-btn" type="submit">保存数据</button>
            <button class="layui-btn layui-btn-danger" data-history-back data-confirm="确定要取消编辑吗？" type='button'>取消编辑</button>
        </div>
    </div>
</form>
{/block}

{block name='script'}
<script>

    $('#no_input').blur(function() {
        console.log("yy");
        var val=this.value;console.log(val);
        $.post('fx/product.shop/check_no',{no:val,id:{$vo.id|default=0}},function(res){
            if(res=="y"){layer.msg('编号重复');}
            
        })
    })
    
</script>
{/block}